package com.chencong.online.function;

import com.chencong.online.bean.AdClinkBehaviorBean;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @program: user-behavior-analysis-online
 * @ClassName AdClinkBehaviorMapFunc
 * @description:
 * @author: chencong
 * @create: 2021-12-29 13:59
 **/
public class AdClinkBehaviorMapFunc implements MapFunction<String, AdClinkBehaviorBean> {
    @Override
    public AdClinkBehaviorBean map(String value) throws Exception {
        String[] split = value.split(",");
        Long userId = Long.valueOf(split[0]);
        Long adId = Long.valueOf(split[1]);
        String province = split[2];
        String city = split[3];
        Long timestamp = Long.valueOf(split[4]);
        return new AdClinkBehaviorBean(userId, adId, province, city, timestamp);
    }
}
